import { InfoCircleFilled } from '@ant-design/icons';
import { Tooltip } from '../../../../functionalComponent';
import { Layout } from '../../../../util';

/**
 * 表格右上角动态显示提示控件
 *
 */
export default ({ children, iconVisible = false }) => {
  if (!iconVisible) {
    return <Layout.Flex direction="column">{children}</Layout.Flex>;
  }
  return (
    <Layout.Flex direction="column">
      <div style={{ display: 'flex', justifyContent: 'flex-end', padding: 5 }}>
        <Tooltip title={'在当前单据转换关系中，管理员配置了不允许重复引用来源数据，因此部分数据处于禁用状态。'}>
          <InfoCircleFilled style={{ color: 'var(--color-waring)', justifyItems: 'flex-end' }} />
        </Tooltip>
      </div>
      <Layout.Flex>{children}</Layout.Flex>
    </Layout.Flex>
  );
};
